using Assets.Scripts.GDK;
using System;
using UnityEngine;
using UnityEngine.UI;

namespace Brick
{
	public class SliderBox : gdk_base_UI
	{
		public Slider shootSlider;

		private Vector2 muzpos;

		private bool bMoveEnd;

		public void onShowEvent()
		{
			base.gameObject.SetActive(value: true);
			bMoveEnd = false;
			muzpos = GDK.ModuleManger.Module<BallFindWayModule>().GetWordShootPos();
		}

		public void onHideEvent()
		{
			base.gameObject.SetActive(value: false);
		}

		public void OnBackClick()
		{
			gdk_game_manager.PlaySound(AudioID.click);
			gdk_game_manager.DispachEvent(EventID.SHOW_PLAY_MENU);
		}

		public void SliderMove(float num)
		{
			Vector2 obj = new Vector2(-250f + muzpos.x + (float)Convert.ToInt32(shootSlider.value * 100f) * 5f, muzpos.y + 30f);
			GDK.ModuleManger.Module<MuzzuleBoxModule>().isEndMove = false;
			gdk_game_manager.DispachEvent(EventID.GAME_SHOOT_MOVE, obj);
		}
	}
}

